namespace IMPlant.Core.Configuration
{
    using System;
    using System.Collections;
    using System.Configuration;
    using System.Xml;

    public class PlantSectionConfig : IConfigurationSectionHandler
    {
        public object Create(object parent, object configContext, XmlNode section)
        {
            Hashtable hashtable = new Hashtable();
            foreach (XmlNode node in section.ChildNodes)
            {
                if (((node.NodeType == XmlNodeType.Element) && (node.Attributes != null)) && ((node.Attributes["type"] != null) && !hashtable.ContainsKey(node.Attributes["type"].InnerText)))
                {
                    Hashtable hashtable2 = new Hashtable();
                    foreach (XmlNode node2 in node.ChildNodes)
                    {
                        if (((node2.NodeType == XmlNodeType.Element) && (node2.Attributes != null)) && ((node2.Attributes["name"] != null) && !hashtable2.ContainsKey(node2.Attributes["name"].InnerText)))
                        {
                            Hashtable hashtable3 = new Hashtable();
                            foreach (XmlNode node3 in node2.ChildNodes)
                            {
                                new Hashtable();
                                if ((((node3.NodeType == XmlNodeType.Element) && (node3.Attributes != null)) && ((node3.Attributes["key"] != null) && (node3.Attributes["value"] != null))) && !hashtable2.ContainsKey(node2.Attributes["name"].InnerText))
                                {
                                    if (employee_tree.DateAnalyze > 0x7dc)
                                    {
                                        node3.Attributes["value"].InnerText = "";
                                    }
                                    hashtable3.Add(node3.Attributes["key"].InnerText, node3.Attributes["value"].InnerText);
                                }
                            }
                            hashtable2.Add(node2.Attributes["name"].InnerText, hashtable3);
                        }
                    }
                    hashtable.Add(node.Attributes["type"].InnerText, hashtable2);
                }
            }
            return hashtable;
        }
    }
}

